package com.jueyue.dao.parse.sqls;

import java.io.BufferedReader;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.Set;

public class SqlFileBuilder {

	private static final int LINE = '\n';

	public LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();

	public SqlFileBuilder(BufferedReader reader) throws IOException {
		InnerStack stack = new InnerStack();
		int c;
		stack.eat(LINE);
		while (-1 != (c = reader.read())) {
			stack.eat(c);
		}
		if (stack.key != null)
			stack.addOne();
		map = stack.map;
		reader.close();
	}

	public Set<String> keys() {
		return map.keySet();
	}

	public String get(String key) {
		return map.get(key);
	}
}
